/*
 * Copyright 2008 Zoundry LLC, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package org.zoundry.gaedt.services.applications;

import java.util.Map;

/**
 * Data model class to extract and query information about the Google App
 * Engine application as it is defined by the app.yaml file.
 */
public class ZGaeApplicationYAML
{
    /** The application's name. */
    private String mName;
    /** The version. */
    private long mVersion;
    /** The runtime: 'python', etc. */
    private String mRuntime;
    /** The API version. */
    private long mApiVersion;

    /**
     * Construct the object from a Map of YAML data.
     * 
     * @param aYamlData
     */
    public ZGaeApplicationYAML(Map aYamlData)
    {
        String application = (String) aYamlData.get("application");
        String runtime = (String) aYamlData.get("runtime");
        Long version = (Long) aYamlData.get("version");
        Long apiVersion = (Long) aYamlData.get("api_version");
        
        setName(application);
        setRuntime(runtime);
        setVersion(version);
        setApiVersion(apiVersion);
    }

    /**
     * @return the name
     */
    public String getName()
    {
        return mName;
    }

    /**
     * @param aName the name to set
     */
    public void setName(String aName)
    {
        mName = aName;
    }

    /**
     * @return the version
     */
    public long getVersion()
    {
        return mVersion;
    }

    /**
     * @param aVersion the version to set
     */
    public void setVersion(long aVersion)
    {
        mVersion = aVersion;
    }

    /**
     * @return the runtime
     */
    public String getRuntime()
    {
        return mRuntime;
    }

    /**
     * @param aRuntime the runtime to set
     */
    public void setRuntime(String aRuntime)
    {
        mRuntime = aRuntime;
    }

    /**
     * @return the apiVersion
     */
    public long getApiVersion()
    {
        return mApiVersion;
    }

    /**
     * @param aApiVersion the apiVersion to set
     */
    public void setApiVersion(long aApiVersion)
    {
        mApiVersion = aApiVersion;
    }
}
